package com.j2203.service.impl;

import com.j2203.service.SendEmailService;
import com.j2203.utils.EmailUtils;
import com.j2203.vo.ResultMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.mail.MessagingException;

@Service
public class SendEmailServiceImpl implements SendEmailService {

    @Autowired
    private EmailUtils emailUtils;
    @Override
    public ResultMsg sendMail(String toMail) throws MessagingException {
        ResultMsg resultMsg = new ResultMsg();
        System.out.println(); String s = emailUtils.sendMail(toMail);
        resultMsg.setStatus(200);
        resultMsg.setData(s);
        return resultMsg;
    }
}
